package com.example.gamestore.Bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.text.SimpleDateFormat;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class Content {
    @TableId(type = IdType.AUTO)
    private Integer id;
    private String content;
    @TableField("create_time")
    private Date createtime;
    private Integer gameId;
    private Integer authorId;
    private String title;
    @TableField(exist = false)
    private String authorname;

    public String Timechange() {
        SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年-MM月-dd日 HH时:mm分:ss秒");
        String format = sdf1.format(this.createtime);
        return format;
    }
}
